package com.szrt.cll.test.student.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.szrt.cll.test.core.base.BaseController;
import com.szrt.cll.test.core.base.BaseService;
import com.szrt.cll.test.student.entity.StudentEntity;
import com.szrt.cll.test.student.service.StudentService;

@Controller
@RequestMapping("/student")
public class StudentController extends BaseController<StudentEntity>{

	@Autowired
	private StudentService service;
	
	@Override
	public BaseService<StudentEntity> getBaseService() {
		
		return service;
	}
	
	@ResponseBody
	@RequestMapping("/findAllName")
	public Map<String,Object> findAllName(Integer page, Integer rows){
		System.err.println("进入findAllName方法....");
		if(null == page){
			page=1;
		}
		
		Map<String,Object> pageMap = new HashMap<String,Object>();
		
		List<StudentEntity> list=service.findAllName(pageMap);
		Map<String,Object> map=new HashMap<>();
		
		
		map.put("rows",list);
		map.put("result","success");
		
		return map;
	}

}
